package com.zbkj.front.task;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.zbkj.service.service.project.CityWeightService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Auther:
 * @Date: 2024/9/29 10:48
 * @Description:
 */
@Slf4j
@Component
public class ProjectJobTask {
    @Autowired
    private CityWeightService cityWeightService;


    /**
     * 按市人工月费用缓存刷新任务
     * @return
     */
    @XxlJob("cityWeightCacheRefreshTask")
    public ReturnT<String> cityWeightCacheRefreshTask() {
        String result = "success";
        try {
            cityWeightService.cityWeightCacheRefresh(1);
        } catch (Exception e) {
            result = "fail";
            log.error("cityWeightCacheRefreshTask-error:",e);
        }
        log.error("cityWeightCacheRefreshTask-run-{}",result);
        return ReturnT.SUCCESS;
    }
}
